import {createRouter, createWebHistory, RouteRecordRaw} from 'vue-router'

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'login',
        alias: ['/login'],   // 别名，可以定义很多个
        component: () => import('../view/Login.vue'),
    },
    {
        path: '/a',
        name: 'a',
        component: () => import('../view/Admin.vue'),
        children: [
            {
                path: 'config/info/page',
                name: 'ConfigInfoPage',
                component: () => import('../view/sys/config/info/ConfigInfoPage.vue')
            }, {
                path: 'table/info/page',
                name: 'TableInfoPage',
                component: () => import('../view/sys/table/info/TableInfoPage.vue')
            }, {
                path: 'column/info/page',
                name: 'ColumnInfoPage',
                component: () => import('../view/sys/column/info/ColumnInfoPage.vue')
            }, {
                path: 'index/info/page',
                name: 'IndexInfoPage',
                component: () => import('../view/sys/index/info/IndexInfoPage.vue')
            }, {
                path: 'index/column/info/page',
                name: 'IndexColumnInfoPage',
                component: () => import('../view/sys/index/column/info/IndexColumnInfoPage.vue')
            }, {
                path: 'code/info/page',
                name: 'CodeInfoPage',
                component: () => import('../view/sys/code/info/CodeInfoPage.vue')
            }, {
                path: 'code/page',
                name: 'CodePage',
                component: () => import('../view/sys/code/CodePage.vue')
            }, {
                path: 'select/info/page',
                name: 'SelectInfoPage',
                component: () => import('../view/sys/select/info/SelectInfoPage.vue')
            }, {
                path: 'relate/info/page',
                name: 'RelateInfoPage',
                component: () => import('../view/sys/relate/info/RelateInfoPage.vue')
            }, {
                path: 'dict/info/page',
                name: 'DictInfoPage',
                component: () => import('../view/sys/dict/info/DictInfoPage.vue')
            }, {
                path: 'dict/type/page',
                name: 'DictTypePage',
                component: () => import('../view/sys/dict/type/DictTypePage.vue')
            }, {
                path: 'dict/data/page',
                name: 'DictDataPage',
                component: () => import('../view/sys/dict/data/DictDataPage.vue')
            }
        ]
    },
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router